package com.zkzx.company.api.client.driver;

import com.zkzx.common.driver.command.DriverCommand;
import com.zkzx.common.driver.model.DriverListVO;
import com.zkzx.common.driver.model.DriverVO;
import com.zkzx.common.driver.vo.DriverStatusVO;
import com.zkzx.common.exception.BaseException;
import com.zkzx.common.vo.PageResult;
import com.zkzx.common.vo.StatusVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 北京中科智兴物联科技有限公司 @版权所有
 *
 * @Author: zhaoyihe@zkraising.com
 * @Date: 2021/05/08/16:42
 * @Description:
 */
@FeignClient(value = "ZKZX-DRIVER") // 本地调用 先以接口地址为准进行调用
//@FeignClient(name = "ZKZX-DRIVER",url = "http://localhost:28081")
public interface DriverClient {

    @GetMapping("/ZKZX-DRIVER/drivers")
    PageResult<DriverListVO> find(@ApiParam(value = "查询参数") @RequestParam("filterParam") String driverFilterParam,
                                  @ApiParam(value = "分页查询参数")  @RequestParam("params") String params);

    @GetMapping("/ZKZX-DRIVER/drivers/{id}")
    DriverVO getById(@PathVariable("id") Integer id,  @RequestHeader("companyId") Integer companyId);

    @PostMapping("/ZKZX-DRIVER/drivers")
    StatusVO add(@RequestBody DriverCommand command, @RequestHeader("userId") Integer userId) throws BaseException;

    @PutMapping("/ZKZX-DRIVER/drivers/{id}")
    void update(@RequestBody DriverCommand command, @PathVariable("id") Integer id, @RequestHeader("userId") Integer userId);

    @PostMapping("/ZKZX-DRIVER/drivers/{id}/verification")
    @ApiOperation(value = "获取验证码", notes = "获取验证码")
    DriverStatusVO verification(@PathVariable("id")Integer id,@RequestHeader("userId")Integer userId,@RequestHeader("companyId")Integer companyId);


    @PostMapping("/ZKZX-DRIVER/drivers/{id}")
    @ApiOperation(value = "提交", notes = "提交")
    DriverStatusVO submit(@PathVariable("id")Integer id,@RequestParam("captcha")String  captcha,@RequestHeader("userId")Integer userId,@RequestHeader("companyId")Integer companyId);


    @PostMapping("/ZKZX-DRIVER/drivers/{id}/contract")
    @ApiOperation(value = "邀请签约", notes = "邀请签约")
    DriverStatusVO contract(@PathVariable("id")Integer id,@RequestParam("end_time")String endTime,@RequestHeader("userId")Integer userId,@RequestHeader("companyId")Integer companyId);


    }
